const getExcelDataToArray = require('./excelProcess');
const insertWord = require('./insertDatabase');

async function insertWordInDatabase() {
  const data = await getExcelDataToArray();
  for(let i= 0; i < data.length; i++) {
    const result = await insertWord(data[i].word, data[i].pronunciation, data[i].explanation);
    if(result) {
      console.log("第" + (i + 1) + "条数据插入成功!");
    } else {
      console.log('='.repeat(20));
      console.log("第" + (i + 1) + "条数据插入失败!");
    }
  }

  
}
insertWordInDatabase();


